import request from '@/utils/request'
let baseUrl = process.env.NODE_ENV === 'production' ? 'api/report' : '/report'
export const typeList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/statistics/report/type-list',
    method: 'post',
    data
  })
export const create = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/statistics/report/create',
    method: 'post',
    data
  })
export const save = (data?: any) =>
  request({
    headers: {
      'X-Portal-Name': 'name'
    },
    baseURL: baseUrl,
    url: '/statistics/report/save',
    method: 'post',
    data
  })
export const deleteReport = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/statistics/report/delete',
    method: 'post',
    data
  })
export const detail = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/statistics/report/detail',
    method: 'post',
    data
  })
export const query = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/statistics/report/query',
    method: 'post',
    data
  })
export const exportReport = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/statistics/report/export',
    method: 'post',
    data
  })
export const checkDuplicateFieldName = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/statistics/report/check-duplicate-name',
    method: 'post',
    data
  })
